﻿using SD.Infrastructure.AppServiceBase;
using SlamDunk.MES.IAppService.DTOs.Outputs.ResourceContext;
using SlamDunk.MES.ReportView.Models;
using SlamDunk.ValueObjects.Enums;
using System;
using System.Collections.Generic;
using System.ServiceModel;

namespace SlamDunk.MES.IAppService.Interfaces
{
    /// <summary>
    /// 报表统计服务契约接口
    /// </summary>
    [ServiceContract]
    public interface IReportContract : IApplicationService
    {
        #region # 获取作业计划物料出/入库概要列表 —— IEnumerable<MaterialSummaryInfo> GetExecutionPlanMaterialBoundSummaries(...
        /// <summary>
        /// 获取作业计划物料出/入库概要列表
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="directionType">出/入库类型</param>
        /// <returns>物料出/入库概要列表</returns>
        [OperationContract]
        IEnumerable<MaterialSummaryInfo> GetExecutionPlanMaterialBoundSummaries(Guid executionPlanId, StockDirectionType directionType);
        #endregion

        #region # 获取作业计划人员使用概要列表 —— IEnumerable<PersonSummaryInfo> GetExecutionPlanPersonUseSummaries(...
        /// <summary>
        /// 获取作业计划人员使用概要列表
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <returns>人员使用概要列表</returns>
        [OperationContract]
        IEnumerable<PersonSummaryInfo> GetExecutionPlanPersonUseSummaries(Guid executionPlanId);
        #endregion

        #region # 获取作业计划设备使用概要列表 —— IEnumerable<EquipmentSummaryInfo> GetExecutionPlanEquipmentUseSummaries(...
        /// <summary>
        /// 获取作业计划设备使用概要列表
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <returns>设备使用概要列表</returns>
        [OperationContract]
        IEnumerable<EquipmentSummaryInfo> GetExecutionPlanEquipmentUseSummaries(Guid executionPlanId);
        #endregion

        #region # 获取作业计划物料使用概要列表 —— IEnumerable<MaterialSummaryInfo> GetExecutionPlanMaterialUseSummaries(...
        /// <summary>
        /// 获取作业计划物料使用概要列表
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="directionType">物料输入/输出类型</param>
        /// <returns>物料使用概要列表</returns>
        [OperationContract]
        IEnumerable<MaterialSummaryInfo> GetExecutionPlanMaterialUseSummaries(Guid executionPlanId, MaterialDirectionType directionType);
        #endregion

        #region # 获取产品合格率字典 —— IDictionary<MaterialInfo, decimal> GetProductQualifiedRates(DateTime inspectedDate)
        /// <summary>
        /// 获取产品合格率字典
        /// </summary>
        /// <param name="inspectedDate">质检日期</param>
        /// <returns>产品合格率字典</returns>
        [OperationContract]
        IDictionary<MaterialInfo, decimal> GetProductQualifiedRates(DateTime inspectedDate);
        #endregion

        #region # 获取物料投入周期概要字典 —— {DateTime, MaterialQuantityInfo[]} GetMaterialInputPeriodicSummaries(...
        /// <summary>
        /// 获取物料投入周期概要字典
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>物料投入周期概要字典</returns>
        /// <remarks>
        /// 键：日期，值：物料数量列表
        /// </remarks>
        [OperationContract]
        IDictionary<DateTime, MaterialQuantityInfo[]> GetMaterialInputPeriodicSummaries(DateTime startTime, DateTime endTime);
        #endregion

        #region # 获取产品产出周期概要字典 —— {DateTime, ProductQuantityInfo[]} GetProductOutputPeriodicSummaries(...
        /// <summary>
        /// 获取产品产出周期概要字典
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>产品产出周期概要字典</returns>
        /// <remarks>
        /// 键：日期，值：产品数量列表
        /// </remarks>
        [OperationContract]
        IDictionary<DateTime, ProductQuantityInfo[]> GetProductOutputPeriodicSummaries(DateTime startTime, DateTime endTime);
        #endregion

        #region # 获取作业计划状态/数量字典 —— IDictionary<ExecutionPlanStatus, int> GetExecutionPlanStatusCounts(...
        /// <summary>
        /// 获取作业计划状态/数量字典
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>作业计划状态/数量字典</returns>
        [OperationContract]
        IDictionary<ExecutionPlanStatus, int> GetExecutionPlanStatusCounts(DateTime startTime, DateTime endTime);
        #endregion

        #region # 获取产品数量列表 —— IEnumerable<ProductQuantityInfo> GetProductQuantities(DateTime startTime...
        /// <summary>
        /// 获取产品数量列表
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>产品数量列表</returns>
        [OperationContract]
        IEnumerable<ProductQuantityInfo> GetProductQuantities(DateTime startTime, DateTime endTime);
        #endregion
    }
}
